package com.ruoyi.partybuilding.domain;

import java.util.Date;

import com.easy.query.core.annotation.EasyWhereCondition;
import com.easy.query.core.annotation.Table;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.partybuilding.common.EQuery.CU2Entity;
import com.ruoyi.partybuilding.common.EQuery.ICreatorIdEntity;
import com.ruoyi.partybuilding.common.EQuery.IDeptEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.*;

import javax.validation.constraints.NotBlank;

/**
 * 资讯新闻对象 pb_news
 * 
 * @author he-liangliang@outlook.com
 * @date 2024-11-27
 */
@Table("pb_News")
@Data
public class News extends CU2Entity.LongId implements IDeptEntity , ICreatorIdEntity
{
    private static final long serialVersionUID = 1L;

    /** 标题 ; */
    @ApiModelProperty("标题")
    @EasyWhereCondition
    @NotBlank(message = "标题不能为空")
    @Excel(name = "标题")
    private String title;

    /** 副标题 ; */
    @ApiModelProperty("副标题")
    @EasyWhereCondition
    @Excel(name = "副标题")
    private String subtitle;

    /** 栏目 ; */
    @ApiModelProperty(value = "栏目")
    @EasyWhereCondition(type = EasyWhereCondition.Condition.EQUAL)
    @Excel(name = "栏目")
    private Long typeId;


    /** 来源url ; */
    @ApiModelProperty(value = "来源url")
    @Excel(name = "来源url")
    private String source;

    /** 是否原创：0是，1否 ; */
    @ApiModelProperty(value = "是否原创：0是，1否")
    @Excel(name = "是否原创：0是，1否")
    private Long isOriginal;

    /** 封面图片json[] ; */
    @ApiModelProperty(value = "封面图片json[]")
    @Excel(name = "封面图片json[]")
    private String imgs;

    /** 展示方式：0页面，1外部跳转 ; */
    @ApiModelProperty(value = "展示方式：0页面，1外部跳转")
    @Excel(name = "展示方式：0页面，1外部跳转")
    private Long showType;

    /** 附件json[] ; */
    @ApiModelProperty(value = "附件json[]")
    @Excel(name = "附件json[]")
    private String files;

    @ApiModelProperty(value = "是否幻灯片：0是，1否")
    Integer isscroll;

    @ApiModelProperty("预留给前端的配置存储字段")
    String showCfg;
    /** 内容 ; */
    @ApiModelProperty(value = "内容")
    @Excel(name = "内容")
    private String content;

    /** 发布时间 ; */
    @ApiModelProperty(value = "发布时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "发布时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date releaseTime;

    /** 作者 ; */
    @ApiModelProperty(value = "作者")
    @Excel(name = "作者")
    private String author;

    /** 部门 ; */
    @ApiModelProperty(value = "部门")
    @EasyWhereCondition(type = EasyWhereCondition.Condition.EQUAL)
    @Excel(name = "部门")
    private Long deptId;
    @ApiModelProperty(value = "排序")
     Long sort;

    @ApiModelProperty(value = "创建人")
    Long creatorId;

    @ApiModelProperty(value = "热度,",notes = "小于1表示非热点，值越大热度越高,查询热度：可用hot=1查询热度大于0的数据")
    @EasyWhereCondition(type = EasyWhereCondition.Condition.RANGE_LEFT_CLOSED)
    Integer hot;
    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("title", getTitle())
            .append("subtitle", getSubtitle())
            .append("typeId", getTypeId())
            .append("source", getSource())
            .append("isOriginal", getIsOriginal())
            .append("imgs", getImgs())
            .append("showType", getShowType())
            .append("files", getFiles())
            .append("content", getContent())
            .append("releaseTime", getReleaseTime())
            .append("author", getAuthor())
            .append("deptId", getDeptId())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}
